package org.aeon;

import lombok.extern.slf4j.Slf4j;
import org.aeon.client.ChatClient;
import org.aeon.client.context.GlobalContext;
import org.aeon.client.view.AccountUI;

import javax.swing.*;
import java.lang.reflect.InvocationTargetException;

/**
 * @author: MissingAeon
 * @date: 2024年1月26日 11点20分
 * @description:
 */
@Slf4j
public class Main {
    public static void main(String[] args) {
        startUp();
    }

    public static void startUp() {
        GlobalContext.getContext().getThreadPool().execute(() -> {
            try {
                SwingUtilities.invokeAndWait(() -> {
                    final AccountUI accountUI = new AccountUI();
                    accountUI.setVisible(true);
                });
            } catch (InterruptedException | InvocationTargetException e) {
                log.error(e.getMessage(), e);
            }
            new ChatClient().startUp();
        });
    }
}
